import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';

@Entity('copilot_configs')
export class CopilotConfig {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'config_name', length: 100, default: 'default' })
  configName: string;

  @Column({ name: 'github_token', type: 'text', nullable: true })
  githubToken: string;

  @Column({ name: 'auth_token', type: 'text', nullable: true })
  authToken: string;

  @Column({ name: 'default_model', length: 100, default: 'claude-3.5-sonnet' })
  defaultModel: string;

  @Column({ name: 'api_url', length: 255, default: 'https://api.individual.githubcopilot.com' })
  apiUrl: string;

  @Column({ name: 'timeout', type: 'int', default: 30000 })
  timeout: number;

  @Column({ name: 'retry_attempts', type: 'int', default: 3 })
  retryAttempts: number;

  @Column({ name: 'user_agent', length: 255, default: 'GithubCopilot/1.348.0' })
  userAgent: string;

  @Column({ name: 'proxy_enabled', type: 'boolean', default: false })
  proxyEnabled: boolean;

  @Column({ name: 'proxy_url', length: 255, nullable: true })
  proxyUrl: string;

  @Column({ name: 'proxy_username', length: 100, nullable: true })
  proxyUsername: string;

  @Column({ name: 'proxy_password', length: 100, nullable: true })
  proxyPassword: string;

  @Column({ name: 'debug_mode', type: 'boolean', default: false })
  debugMode: boolean;

  @Column({ name: 'log_requests', type: 'boolean', default: false })
  logRequests: boolean;

  @Column({ name: 'log_responses', type: 'boolean', default: false })
  logResponses: boolean;

  @Column({ name: 'is_active', type: 'boolean', default: true })
  isActive: boolean;

  @CreateDateColumn({ name: 'created_at' })
  createdAt: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt: Date;
}